/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CastleDefense;

/**
 *
 * @author Firedemon
 */
import java.util.ArrayList;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

//This statement means that class "UnitList.java" is the root-element of our example
@XmlRootElement(namespace = "HelpList")
public class HelpList
{
    // XmLElementWrapper generates a wrapper element around XML representation
    @XmlElementWrapper(name = "HelpList")
    @XmlElement(name = "help")
    private ArrayList<Help> HelpList;

    public void setUnitList(ArrayList<Help> HelpList)
    {
        this.HelpList = HelpList;
    }

    public ArrayList<Help> getUnitsList()
    {
        return HelpList;
    }
    
    public String getHelpById(int id)
    {
        for (Help tmpHelp : HelpList)
        {
            if(tmpHelp.getId()==id)
                return tmpHelp.getText();
        }
        return null;
    }
    
    public Integer size()
    {
        return HelpList.size();
    }
}
